/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.una.informatica.entidades;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author MARTINCHO
 */
@Entity
@Table(name = "signos_comparacion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SignosComparacion.findAll", query = "SELECT s FROM SignosComparacion s"),
    @NamedQuery(name = "SignosComparacion.findByIdSignoComparacion", query = "SELECT s FROM SignosComparacion s WHERE s.idSignoComparacion = :idSignoComparacion"),
    @NamedQuery(name = "SignosComparacion.findByValor", query = "SELECT s FROM SignosComparacion s WHERE s.valor = :valor"),
    @NamedQuery(name = "SignosComparacion.findByDescripcion", query = "SELECT s FROM SignosComparacion s WHERE s.descripcion = :descripcion")})
public class SignosComparacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_signo_comparacion")
    private Long idSignoComparacion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "valor")
    private String valor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idSignoComparacion")
    private Collection<Reglas> reglasCollection;

    public SignosComparacion() {
    }

    public SignosComparacion(Long idSignoComparacion) {
        this.idSignoComparacion = idSignoComparacion;
    }

    public SignosComparacion(Long idSignoComparacion, String valor, String descripcion) {
        this.idSignoComparacion = idSignoComparacion;
        this.valor = valor;
        this.descripcion = descripcion;
    }

    public Long getIdSignoComparacion() {
        return idSignoComparacion;
    }

    public void setIdSignoComparacion(Long idSignoComparacion) {
        this.idSignoComparacion = idSignoComparacion;
    }

    public String getValor() {
        return valor;
    }

    public void setValor(String valor) {
        this.valor = valor;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    @XmlTransient
    public Collection<Reglas> getReglasCollection() {
        return reglasCollection;
    }

    public void setReglasCollection(Collection<Reglas> reglasCollection) {
        this.reglasCollection = reglasCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSignoComparacion != null ? idSignoComparacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SignosComparacion)) {
            return false;
        }
        SignosComparacion other = (SignosComparacion) object;
        if ((this.idSignoComparacion == null && other.idSignoComparacion != null) || (this.idSignoComparacion != null && !this.idSignoComparacion.equals(other.idSignoComparacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.una.informatica.entidades.SignosComparacion[ idSignoComparacion=" + idSignoComparacion + " ]";
    }
    
}
